FIG. 7 is a circuit diagram of conventional power supply device 5001. Transistors 3 and 4 are connected to direct-current (DC) power supply 2 connected to input terminal 1. A primary coil of transformer 5 is connected to a node at which transistors 3 and 4 are connected. A voltage supplied from a secondary coil of transformer 5 is supplied to low-pass filter 6. A voltage output from low-pass filter 6 is supplied to output terminal 7. Load 8, such as a roller of a printer, is connected to output terminal 7.
FIG. 8 shows voltages 801 through 804 in power supply device 5001. Voltage 802 is output from output terminal 7. Voltage 803 is a predetermined voltage to be output from output terminal 7. A voltage at output terminal 7 is detected by voltage detector 9 and supplied to a negative input port of comparator 10. Reference signal generator 11 that generates a predetermined alternating-current (AC) voltage is connected to a positive input port of comparator 10. Comparator 10 compares the voltage detected by voltage detector 9 with the voltage output from reference signal generator 11. In other words, when the voltage detected by voltage detector 9 is higher than the voltage output from reference signal generator 11, comparator 10 outputs a voltage at high level. When the voltage detected by voltage detector 9 is lower than the voltage output from reference signal generator 11, comparator 10 outputs a voltage at low level. Thus, comparator 10 output voltage 803. Voltage 803 is supplied to a base of each of transistors 3 and 4. Transistors 3 and 4 connect and disconnect a voltage output from DC power supply 2 to transformer according to voltage 803.
In conventional power supply device 5001, a ripple voltage from voltage detector 9 and reference signal generator 11 is added to voltage 803. Voltage 804 represents voltage 803 in period D. As shown in this figure, one pulse of voltage 803 actually includes a large number of pulses in period D. A voltage having such a large number of pulses is supplied to the bases of switching elements 3 and 4, and thereby, changes between conduction and nonconduction of switching elements 3 and 4 undesirably by times identical to the number of pulses. In other words, transistor 3 conducts by times identical to the number of high-level statuses of the pulses of voltage 803, and transistor 4 conducts by times identical to the number of low-level statuses of voltage 803, thereby increasing a switching loss in transistors 3 and 4.